
message("***Current DEVICE:${DEVICE}")

if("${DEVICE}" STREQUAL "dev-esp32")
message("--- DEV-ESP32 ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_18"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_19"
	# "ZWAY_ESP32_RESCUE_BTN=5" For now we don't think about whether it's secure or not.
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=256"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
elseif("${DEVICE}" STREQUAL "dev-esp32s3")
message("--- DEV-ESP32S3 ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_18"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_17"
	# "ZWAY_ESP32_RESCUE_BTN=5" For now we don't think about whether it's secure or not.
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=1024"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
elseif("${DEVICE}" STREQUAL "dev-wrov1")
message("--- Tes board based on ESP32WROVER (4 MB FLASH/8 MB RAM) ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_18"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_19"
	# "ZWAY_ESP32_RESCUE_BTN=34" For now we don't think about whether it's secure or not.
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=1024"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
elseif("${DEVICE}" STREQUAL "prod-esp32N8R2")
message("--- Production board (Oliver IQ) ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_18"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_19"
	# "ZWAY_ESP32_RESCUE_BTN=34" For now we don't think about whether it's secure or not.
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=1024"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
elseif("${DEVICE}" STREQUAL "prod-xiao")
message("--- Production shield board (Xiao board + Neptune board) ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_43"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_44"
	"ZWAY_ESP32_RST_PIN=GPIO_NUM_8"
	# EXTRA shield extensions for gpio tests
	"XIAO_SHIELD_TEST_EXT=1"
	"XIOA_SHIELD_BTN2=7"
	"XIOA_SHIELD_QWIIC_SDA=5"
	"XIOA_SHIELD_QWIIC_SCL=6"
	"ZWAY_ESP32_RESCUE_BTN=4"
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=1024"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
elseif("${DEVICE}" STREQUAL "dev-esp32p4-eth")
message("--- ESP32P4 NANO boaard by WaveShare. Ethernet interface. ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_21"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_22"
    "ZWAY_ESP32_RST_PIN=GPIO_NUM_20"
	# Ethernet instead of default WiFi
	"ZWAY_ON_ETHERNET=1"
	"ZME_ETH_INTERNAL_ETHERNET=1"
	"ZME_ETH_PHY_IP101=1"
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=1024"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
elseif("${DEVICE}" STREQUAL "dev-esp32p4-wifi")
message("--- ESP32P4 NANO boaard by WaveShare. WiFi interface. ---")
set("DEVICE_SPECIFIC_DEFS"
	# Pin mapping
	"ZWAY_ESP32_UART1_TX=GPIO_NUM_21"
	"ZWAY_ESP32_UART1_RX=GPIO_NUM_22"
	"ZWAY_ESP32_RST_PIN=GPIO_NUM_20"
	# Memory definitions
	"ZWAY_ESP32_WEB_SCRATCH_BUFSIZE=1024"
	# Debug flags
	"ZWAY_ESP32_DEBUG=1"
	"ZWAY_ESP32_DEFAULT_ZWAY_LOG_LEVEL=Debug"
)
endif()

set(PROJECT_CONFIG_DEFINE
	"ZWAY_ESP32_WEB_SERVER_STACK=8000"
	${DEVICE_SPECIFIC_DEFS}
)

foreach(def_str ${PROJECT_CONFIG_DEFINE})
	message("DEF_LINE:${def_str}")
endforeach()